name: Check Size

on:
  push:
    branches: [main, release-*]
  pull_request:
    branches: [main, release-*]

env:
  GO_VERSION: '1.21'

jobs:
  check_size:
    name: Check Size
    timeout-minutes: 10
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Check large files
        uses: actionsdesk/lfs-warning@v3.2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          filesizelimit: "1048576"
          exclusionPatterns: |
            deploy/helm-charts
            manager/console
